This invention relates to a boundary line detection apparatus and method, and an image processing apparatus and method as well as a recording medium, and more particularly to a boundary line detection apparatus and method, and an image processing apparatus and method as well as a recording medium by which jaggy can be suppressed.
In order to determine image data corresponding to an image to be displayed on a display screen typically of a computer with which a game is played, high accuracy arithmetic operation is executed usually using floating point arithmetic. The display screen is represented with pixels displayed two-dimensionally. In other words, image data are displayed by a set of pixels having designated pixel values, that is, designated color data.
Where image data calculated by a computer represent, for example, such an image composed of a white portion 2 and a black portion 3 divided by an oblique boundary line 1 as shown in FIG. 1, each of pixels for displaying the image has a pixel value of the image data in accordance with its position. Therefore, the pixels included in the white portion 2 have color data of the white and the pixels included in the black portion 3 have color data of the black. Consequently, the pixels have such pixel values as seen in FIG. 2.
FIG. 3 shows the display screen displayed with the pixels shown in FIG. 2. Although the boundary line of the original image data is an oblique straight line, the boundary between the white and black areas on the screen on which it is displayed is displayed in a stepwise shape as seen in FIG. 3. The phenomenon wherein a portion which originally is a straight line is displayed in a stepwise shape in this manner is called jaggy.
In order to solve the problem of the jaggy, pixels in the proximity of the boundary line 1 should be displayed with an intermediate color (in the example shown, gray) of the color data represented by two pixels on the opposite sides of the boundary. In particular, an ideal method for determining a pixel of a display image is to determine, from high accuracy image data arithmetically operated by a computer, an average value of pixel values in the inside of a square 4 centered at a noticed pixel (I, J) and having sides equal to the distance α between pixels of the display image based on the image data as seen in FIG. 5 and use the average value as a pixel value of the display image. An image processing method called supersampling can be used for the calculation.
The supersampling is a method of determining data for a pixel on a screen by dividing the pixel into smaller units called subpixels and using an average value of the subpixels as pixel data of the pixel. For example, one pixel is divided by four in each of vertical and horizontal directions and hence into 16 portions, and rendering is performed for the individual imaginary pixels. Then, an average value of the imaginary pixels obtained by the rendering is used as a pixel value of the pixel. In other words, the juggy is suppressed by raising the sampling rate.
However, if supersampling is executed simply, then the rendering time increases in proportion to the number of sub pixels, and consequently, the time required for image processing increases significantly. Therefore, in such an application in which the image processing speed cannot be reduced such as a game, devices of a high performance must be used for an arithmetic operation section and a storage section, which results in significant increase in cost.